package com.crazy.rabbitmq.mq;


import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

@Component
public class MqSender {

	@Autowired
    private AmqpTemplate rabbitTemplate;
	
	@Value("${spring.rabbitmq.queue}")
	private String queue;

    public void send() {
        String sendMsg = "hello world";
        this.rabbitTemplate.convertAndSend(queue, sendMsg);
    }
    
}
